<template>
  <div style="border-radius: 4px; border: 1px solid black; text-align: left; height: 200px">
    <div style="display:inline-block; float: left; margin-top: 15px; margin-left: 15px" >
      <img :src="scenic.coverImage" width="220px" height="170px">
    </div>
    <div style="display:inline-block;  width: 65%;
                margin-left: 14px; margin-top: 10px;
                white-space: nowrap; overflow: hidden;text-overflow: ellipsis;">
      <a @click="getscenicPageById(scenic.id)"
         style="text-decoration: none; font-family: 楷体; font-size: 22px; cursor: pointer">
        {{scenic.title}}
      </a>
    </div>
    <div style="display:inline-block;
          width: 65%; margin-left: 14px; margin-top: 3px">
      <p>
        {{scenic.content}}
      </p>
    </div>



  </div>

</template>

<script>
export default {
  name: "scenicComponent",
  props:{
    scenic: Object
  },
  methods: {
    likeOrDislike: function (){
      if(this.like == 0){
        this.like=1;
        this.star="el-icon-star-on"
      }else{
        this.like=0;
        this.star="el-icon-star-off"
      }
    },
    getscenicPageById: function (id){
      this.$router.push({path: '/scenic/'+id})
    }
  },
  data(){
    return{
      like: 0,
      star: "el-icon-star-off",
    }
  }
}
</script>

<style scoped>
a{
  color: black;
}
a:hover{
  color: #E6A23C;
}
p {
  position:relative;
  line-height:1.5em;
  /* 高度为需要显示的行数*行高，比如这里我们显示两行，则为3 */
  height:9em;
  overflow:hidden;
}
p:after {
  content:"...";
  position:absolute;
  bottom:0;
  right:0;
  padding: 0 5px;
  background-color: #fff;
}

</style>